package lcy.homework01;

/**
 * @ClassName: ControllerMain
 * @Description:
 * @author: 李春洋
 * @date: 2024/3/30 16:27
 * @Blog: https://
 */
public class ControllerMain {
    public static void main(String[] args) {
        // 测试代码
        Point center = new Point(0, 0);
        Circle circle1 = new Circle(center, 5);
        Circle circle2 = new Circle(center, 5);
        System.out.println("圆 1: " + circle1);
        System.out.println("圆 2: " + circle2);
        System.out.println("圆 1 equals 圆 2: " + circle1.equals(circle2));

        System.out.println("HashCode 圆 1: " + circle1.hashCode());
        System.out.println("HashCode 圆 2: " + circle2.hashCode());

        Point[] triangleVertices = {new Point(0, 0), new Point(3, 0), new Point(0, 4)};
        Triangle triangle1 = new Triangle(triangleVertices);
        Triangle triangle2 = new Triangle(triangleVertices);
        System.out.println("三角形 1: " + triangle1);
        System.out.println("三角形 2: " + triangle2);
        System.out.println("三角形 1 equals 三角形 2: " + triangle1.equals(triangle2));

        System.out.println("HashCode 三角形 1: " + triangle1.hashCode());
        System.out.println("HashCode 三角形 2: " + triangle2.hashCode());

        Point[] rectangleVertices = {new Point(0, 0), new Point(5, 0), new Point(5, 3), new Point(0, 3)};
        Rectangle rectangle1 = new Rectangle(rectangleVertices);
        Rectangle rectangle2 = new Rectangle(rectangleVertices);
        System.out.println("长方形 1: " + rectangle1);
        System.out.println("长方形 2: " + rectangle2);
        System.out.println("长方形 1 equals 长方形 2: " + rectangle1.equals(rectangle2));

        System.out.println("HashCode 长方形 1: " + rectangle1.hashCode());
        System.out.println("HashCode 长方形 2: " + rectangle2.hashCode());
    }
}
